(define (compose f g)
    (lambda (x) 
        (f (g x))
    )
)


(define (repeated m a)
    (if (= a 1)
        (lambda (x) 
            (m x)
        )
        (compose (repeated m (- a 1)) m)
    )    
)
(define dx 0.00001)
(define (smoth f)
    (lambda (x) 
        (/ (+ (f (- x dx)) (f x) (f (+ x dx)))
            3 
        )
    )
)

(define (square x)
    (* x x)
)
(display ((smoth square) 2))
(newline)
(display ((smoth square) 3))
(newline)

(display (((repeated smoth 10) square) 2))
(newline)
(display (((repeated smoth 10) square) 3))
(exit)